//
// Copyright (c) 1995 Molecular Structure Corporation
//
// RESTRICTED RIGHTS NOTICE SHORT FORM (JUNE 1987)
//
// Use, reproduction, or disclosure is subject to restrictions set
// forth in Contract No. W-31-109-ENG-38 and Contract No. 
// 943072401 with the University of Chicago, Operator of
// Argonne National Laboratory.
//
// CUInumberField.h        Initial author: J.W. Pflugrath           16-Dec-1995
//    This file is the header file for user interface class CUInumberField.
/*
 *
 * Copyright (C) 2014 Rigaku Americas Corporation
 *                    9009 New Trails Drive
 *                    The Woodlands, TX, USA  77381
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *    * Redistributions of source code must retain the above copyright
 *      notice(s), this list of conditions and the following disclaimer.
 *    * Redistributions in binary form must reproduce the above copyright
 *      notice(s), this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 *    * Neither the name of the Rigaku Americas Corporation nor the 
 *      names of its contributors may be used to endorse or promote products
 *      derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL RIGAKU AMERICAS CORPORATION BE LIABLE 
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
*/ 

//
// README: Portions of this file are merged at file generation
// time. Edits can be made *only* in between specified code blocks, look
// for keywords <Begin user code> and <End user code>.
//
//////////////////////////////////////////////////////////////
//
// Header file for CUInumberField
//
//    This file is generated by Builder Xcessory 3.5.1.
//
//    This class is a user interface "component", as described
//    in "Object-Oriented Programming with C++ and OSF/Motif",
//    by Douglas Young, Prentice Hall, 1992. ISBN 0-13-630252-1
//
//////////////////////////////////////////////////////////////
#ifndef CUInumberField_H
#define CUInumberField_H
#include "UIComponent.h"

//
// Globally included information (change thru Output File Names Dialog).
//


//
// Class Specific Includes (change thru the class in Resource Editor).
//



// Begin user code block <head> 

#include <stdio.h>
#include <string.h>
#include "CXhelp.h"

// End user code block <head> 

class CUInumberField : public UIComponent
{

  public:

    CUInumberField(const char *, Widget);
    CUInumberField(const char *);
    virtual ~CUInumberField();
    virtual void create(Widget);
    const char *const  className();
    void set_cuinumberfield_width(XtPointer);
    void set_cuinumberfield_height(XtPointer);
    
    // Begin user code block <public> 
    virtual float fGetValue();
    virtual int nGetValue();
    virtual char *pcGetValue();
    virtual void vSetValue(char*);
    virtual void vSetValue(int);
    virtual void vSetValue(float);
    virtual void vSetFormat(char*);
    virtual void vSetMulAdd(const float, const float);
    virtual void vGetMulAdd(float *, float *);

    // End user code block <public> 
  protected:
    // Classes created by this class
    
    // Widgets created by this class
    Widget _CUInumberField;
    Widget _scrollBar;
    Widget _textField;
    Widget _label;
    Widget _frame;
    
    // These virtual functions are called from the private callbacks 
    // or event handlers intended to be overridden in derived classes
    // to define actions
    
    virtual void vScrollBarCB(Widget, XtPointer, XtPointer);
    virtual void vTextFieldCB(Widget, XtPointer, XtPointer);
    
    // Begin user code block <protected> 
    // End user code block <protected> 
  private: 
    
    //
    // Default application and class resources.
    //
    static String         _defaultCUInumberFieldResources[];
    static UIAppDefault   _appDefaults[];
    static Boolean        _initAppDefaults;
    //
    // Callback client data.
    //
    UICallbackStruct  *_clientDataStructs;
    
    //
    // Callbacks to interface with Motif.
    //
    static void vScrollBarCBCallback(Widget, XtPointer, XtPointer);
    static void vTextFieldCBCallback(Widget, XtPointer, XtPointer);
    
    // Begin user code block <private> 
       CXhelp *m_poXhelp;

       float m_fAdd;
       float m_fMul;
       char m_a30cValue[30];
       char m_a30cFormat[30];

    // End user code block <private> 
};

// Begin user code block <tail> 
// End user code block <tail> 
#endif
